// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        title:{
            get(){
                let PannelNode=this.node.getChildByName('Pannel');
                return !!PannelNode?PannelNode.getComponent(require('UI.Pannel')).title:''
            },
            set(value){
                let PannelNode=this.node.getChildByName('Pannel');
                if(!!PannelNode)
                    PannelNode.getComponent(require('UI.Pannel')).title=value;
            }
        },
        content:{
            get(){
                let contentNode=this.node.getChildByName('警告文字');
                return !!contentNode?contentNode.getComponent(cc.Label).string:'';
            },
            set(value){
                let contentNode=this.node.getChildByName('警告文字');
                if(!!contentNode) contentNode.getComponent(cc.Label).string=value;
            }
        },
        showMask:{
            get(){
                let MaskNode=this.node.getChildByName('背景遮罩');
                return !!MaskNode?MaskNode.active:false;
            },
            set(value){
                let MaskNode=this.node.getChildByName('背景遮罩');
                if(!!MaskNode)
                    MaskNode.active=value;
            }
        }
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {

    },
    clickOk(){
        this.node.destroy();
    }
    // update (dt) {},
});
